#!/usr/bin/env bash

set -e

dir=$(cd $(dirname $0); pwd)

case $1 in
    diff)
        diff -rq ~/.local $dir/.local | grep differ | sed -r "s/Files|and|differ//g" 
        ;;
    sync)
        /usr/bin/rsync -arvc $dir/.local/ ~/.local/
        ;;
    *)
        # rsync
        echo "Usage:"
        echo "    $0 [ diff | sync ]"
        exit 0
        ;;
esac

exit 0
